stop=''
for s in iter(input,stop):
    total=0
    for i in range(len(s)):
        if s[i].isalpha():
            total+=(ord(s[i].upper())-ord('A')+1)
    print(total)